import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNextLine()){
            String str1=scanner.nextLine();
            String str2=scanner.nextLine();
           String ret= func(str1,str2);
            System.out.println(ret);
        }

    }
    private static  String func(String str1,String str2){
        StringBuilder stringBuilder=new StringBuilder();

        for (int i = 0; i <str1.length() ; i++) {
              char ch=str1.charAt(i);
            if(!str2.contains(ch+"")){
                stringBuilder.append(ch);
            }
        }

        return stringBuilder.toString();
    }
}
